package com.hanry;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

import com.beardedhen.androidbootstrap.BootstrapButton;
import com.beardedhen.androidbootstrap.FontAwesomeText;
import com.hanry.communication.CommunicationManager;

public class ModeSelectActivity extends Activity {

	protected static final String MODE_TYPE = "MODE_TYPE";
	
	private FontAwesomeText buttonBack;
	private BootstrapButton wifiButton;
	private BootstrapButton blueToothButton;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.mode_select);
		buttonBack = (FontAwesomeText)this.findViewById(R.id.buttonBack);
		wifiButton = (BootstrapButton)this.findViewById(R.id.wifiButton);
		blueToothButton = (BootstrapButton)this.findViewById(R.id.blueToothButton);
		
		buttonBack.setOnClickListener(new OnClickListener() {
			public void onClick(View view) {
				Intent setIntent = new Intent();
				setIntent.setClass(ModeSelectActivity.this, MenuActivity.class);
				startActivity(setIntent);
			}
		});
		wifiButton.setOnClickListener(new OnClickListener() {
			public void onClick(View view) {
				Intent setIntent = new Intent();
				setIntent.setClass(ModeSelectActivity.this, Main.class);
				setIntent.putExtra(MODE_TYPE, CommunicationManager.WIFI_CONNECT+"");
				startActivity(setIntent);
			}
		});
		blueToothButton.setOnClickListener(new OnClickListener() {
			public void onClick(View view) {
				Intent setIntent = new Intent();
				setIntent.setClass(ModeSelectActivity.this, Main.class);
				setIntent.putExtra(MODE_TYPE, CommunicationManager.BLUETOOTH_CONNECT+"");
				startActivity(setIntent);
			}
		});
	}
}
